<template>
  <div style="margin-top: 50px">
    <el-form
      :model="value"
      ref="productRelationForm"
      label-width="120px"
      style="width: 680px"
      size="small"
    >
      <el-form-item label="微信：">
        <el-input v-model="value.wechat"></el-input>
      </el-form-item>
      <el-form-item label="手机：" prop="phone">
        <el-input
          v-model="value.phone"
          :value="value.actorSocialInfo.phone"
        ></el-input>
      </el-form-item>
      <el-form-item label="邮箱：">
        <el-input v-model="value.email"></el-input>
      </el-form-item>

      <el-form-item style="text-align: center">
        <el-button size="medium" @click="handlePrev"
          >上一步，填写基本信息</el-button
        >
        <el-button
          type="primary"
          size="medium"
          @click="handleFinishCommit('productRelationForm')"
          >完成，提交信息</el-button
        >
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
import { fetchListAll as fetchSubjectList } from "@/api/subject";
import { fetchList as fetchPrefrenceAreaList } from "@/api/prefrenceArea";

export default {
  name: "actorSoicalInfo",
  props: {
    value: Object,
    isEdit: {
      type: Boolean,
      default: false,
    },
  },
  data() {
    return {
      rule: {
        phone: [
          {
            pattern: /^1[3|5|7|8|9]\d{9}$/,
            message: "请输入正确的号码格式",
            trigger: "change",
          },
        ],
      },
    };
  },
  created() {},
  computed: {},
  watch: {},
  methods: {
    handlePrev() {
      this.$emit("prevStep");
    },
    handleFinishCommit(formName) {
      this.$refs[formName].validate((valid) => {
        if (valid) {
          this.$emit("finishCommit", this.isEdit);
        } else {
          this.$message({
            message: "验证失败",
            type: "error",
            duration: 1000,
          });
          return false;
        }
      });
    },
  },
};
</script>

<style scoped>
</style>
